#include "shm.hpp"
#include "namePipe.hpp"

int main()
{
    /*Shm shm(gpathname, gproj_id, gCreater);
    char *shmaddr = (char *)shm.Addr();

    shm.DebugShm();
    sleep(6);

    std::cout << shmaddr << std::endl;*/
    Shm shm(gpathname, gproj_id, gCreater);
    char *shmaddr = (char *)shm.Addr();

    shm.DebugShm();

    namePipe fifo(comm_path, Creater);
    fifo.OpenForRead();

    while (true)
    {
        std::string temp;
        fifo.ReadNamePipe(&temp);

        std::cout << "shm memory content: " << shmaddr << std::endl;
    }
    return 0;
}